/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jrill;

import java.io.Serializable;
import java.util.Date;

/**
 * An activity in {@link Workflow}.
 * @author K.Waga
 */
public interface Activity extends Serializable {
    
    /**
     * Returns due date of this activity.
     * @return the dueDate
     */
    Date getDueDate();

    /**
     * Returns identification of this activity.
     * @return the id
     */
    Long getId();

    /**
     * Returns note of this activity
     * @return the note
     */
    String getNote();

    /**
     * Returns the organization this activity concerns.
     * @return the organization
     */
    String getOrganization();

    /**
     * Returns the owner of this activity.
     * @return the owner
     */
    Participant getOwner();

    /**
     * Returns the date this activity processed.
     * @return the processed
     */
    Date getProcessed();

    /**
     * Returns the role of this activity.
     * @return the role
     */
    String getRole();

    /**
     * Returns the version of this activity.
     * @return the version
     */
    Long getVersion();

    /**
     * Returns workflow this activity belongs to.
     * @return the workflow
     */
    Workflow getWorkflow();

    /**
     * Returns whether this activity is empty or not
     * @return whether this activity is empty or not
     */
    boolean isEmpty();

    /**
     * Returns whether this Activity is being processed concurrently.
     * @return true if this Activity is being processed concurrently, otherwise false.
     */
    boolean isParallel();

    /**
     * Returns whether this Activity is processed
     * @return true if this Activity is already processed, otherwise false.
     */
    boolean isProcessed();
    
    /**
     * Returns whether this Activity is finished for some reason: (processed, cancelled, rejected etc.)
     * @return true if this Activity is closed, otherwise false.
     */
    boolean isFinished();
    /**
     * Sets whether this activity is finished for some reason: processed, cancelled, rejected etc.
     * @param finished true if this Activity is closed, otherwise false.
     */
    void setFinished(boolean finished);

    /**
     * Sets due date of this activity.
     * @param dueDate the dueDate to set
     */
    void setDueDate(Date dueDate);

    /**
     * Sets id of this activity.
     * @param id the id to set
     */
    void setId(Long id);

    /**
     * Sets note in this activity.
     * @param note the note to set
     */
    void setNote(String note);

    /**
     * Sets organization of this activity.
     * @param organization the organization to set
     */
    void setOrganization(String organization);

    /**
     * Sets owner of this activity.
     * @param owner the owner to set
     */
    void setOwner(Participant owner);

    /**
     * Sets wether this activity can be processed concurrently.
     * @param parallel the parallel to set
     */
    void setParallel(boolean parallel);

    /**
     * Sets when this activity is processed.
     * @param processed the processed to set
     */
    void setProcessed(Date processed);

    /**
     * Sets notification group.
     * Activities in same notification group are notified simultaneously.
     * @param group group code or name
     */
    void setNotificationGroup(String group);

    /**
     * Returns notification group.
     * Activities in same notification group are notified simultaneously.
     * @param processed the processed to set
     */
    String getNotificationGroup();
    /**
     * Sets activity group.
     * Activities in same activity group are processed concurrently.
     * @param group group code or name
     */
    void setActivityGroup(String group);
    /**
     * Returns activity group.
     * Activities in same activity group are processed concurrently.
     * @return activity group code or name
     */
    String getActivityGroup();
    
    /**
     * Sets quorum.
     * Workflow requires more number of activities in same activity group than quorum.
     * @param quorum 
     */
    void setQuorum(int quorum);
    /**
     * Returns quorum.
     * Workflow requires more number of activities in same activity group than quorum.
     * @return quorum
     */
    int getQuorum();

    /**
     * Sets role of this activity.
     * @param role the role to set
     */
    void setRole(String role);

    /**
     * Sets version of this activity.
     * @param version the version to set
     */
    void setVersion(Long version);

    /**
     * Sets workflow that this activity belongs to.
     * @param workflow the workflow to set
     */
    void setWorkflow(SimpleWorkflow workflow);

}
